﻿Public Class FormSettings

    Private Sub FormSettings_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Me.Label1.Text = My.Settings.PHPPath
        If Not String.IsNullOrEmpty(My.Settings.PHPPath) OrElse My.Computer.FileSystem.FileExists(My.Settings.PHPPath) Then
            Me.OpenFileDialogMain.InitialDirectory = IO.Path.GetDirectoryName(My.Settings.PHPPath)
            Me.OpenFileDialogMain.FileName = IO.Path.GetFileName(My.Settings.PHPPath)
        Else
            Me.OpenFileDialogMain.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.ProgramFiles
        End If
    End Sub

    Private Sub ButtonChoose_Click(sender As System.Object, e As System.EventArgs) Handles ButtonChoose.Click
        If Me.OpenFileDialogMain.ShowDialog = Windows.Forms.DialogResult.OK Then
            My.Settings.PHPPath = Me.OpenFileDialogMain.FileName
            Me.Label1.Text = My.Settings.PHPPath
        End If
    End Sub
End Class